<?php
/*********
*    首页控制器
*/
namespace Home\Controller;
use Home\Controller\HomeController;
class AreasController extends HomeController {
 	public function _initialize(){
 		parent::_initialize();
 		
 	}
	/**
	 * 获取所有省
	 */
 	public function getProvince(){
 		$province = M('Areas')->where(array('parent_id'=>1))->select();
 		$this->ajaxReturn($province);
 	}
 	/**
 	 * 根据pid获取城市
 	 * 
 	 */
 	public function getAreasByParentId(){
 		$parent_id = I('parent_id');
 		$areas = M('Areas')->where(array('parent_id'=>$parent_id))->select();
 		$this->ajaxReturn($areas);
 	}
}
